<ng-template #extra>
    <button nz-button (click)="handleCancel()" style="margin-right: 10px">
        取消
    </button>
    <button nz-button nzType="primary" (click)="submit()">
        <i nz-icon nzType="save" nzTheme="outline"></i>
        保存
    </button>
</ng-template>

<nz-card [nzTitle]="id ? '编辑订阅' : '创建订阅'" [nzExtra]="extra">
    <form nz-form [formGroup]="group" (ngSubmit)="submit()">
        <!-- <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="id">id</nz-form-label>
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <input nz-input formControlName="id" />
            </nz-form-control>
        </nz-form-item> -->

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="product_id"
                >产品id</nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <nz-select
                    formControlName="product_id"
                    [nzOptions]="productList"
                >
                </nz-select>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="device_id"
                >设备id</nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <nz-select formControlName="device_id" [nzOptions]="deviceList">
                </nz-select>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="user_id"
                >用户id</nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <nz-select formControlName="user_id" [nzOptions]="userList">
                </nz-select>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="channels"
                >通道</nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="">
                <nz-checkbox-group
                    formControlName="channels"
                ></nz-checkbox-group>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="level"
                >等级</nz-form-label
            >
            <nz-form-control [nzSm]="14" [nzXs]="24">
                <nz-input-number
                    formControlName="level"
                    [nzMin]="1"
                    [nzMax]="10"
                    [nzStep]="1"
                ></nz-input-number>
            </nz-form-control>
        </nz-form-item>
    </form>
</nz-card>
